package kofman.test.cps;

import java.util.List;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;

import android.R.drawable;
import android.R.integer;
import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.location.Location;
import android.os.Bundle;
import android.util.Log;

public class mainActivity extends MapActivity {
	private Bundle bundle;
	MapView mapView;
	Drawable drawable ;
	MapController mc;
	List<Overlay> mapOverlays;
	
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main2);
		bundle=this.getIntent().getExtras();
		mapView=(MapView)findViewById(R.id.mapView);
		mapView.setBuiltInZoomControls(true);
		drawable = this.getResources().getDrawable(R.drawable.ic_launcher);
		mc=mapView.getController();
		mapOverlays=mapView.getOverlays();
		double longitude=bundle.getDouble("longitude")*1E6;
		double latitude=bundle.getDouble("latitude")*1E6;
		Log.d("map", "1:"+longitude);
		Log.d("map", "2:"+latitude);
		GeoPoint point=new GeoPoint( (int) latitude , (int)longitude);
//		Drawable drawable=this.getResources().getDrawable(R.drawable.)
        OverlayItem overlayitem = new OverlayItem(point, "kofman", "HAHAH");
        
        Helloitemoverlay itemizedOverlay=new Helloitemoverlay(drawable);
        itemizedOverlay.addItem(overlayitem);
//        
        mapOverlays.add(itemizedOverlay);
        point=new GeoPoint( (int)(121.57317*1E6),(int) (25.033434*1E6));
        OverlayItem overlayitem2 = new OverlayItem(point, "CITY", "123");
//        itemizedOverlay=new Helloitemoverlay(drawable);
        itemizedOverlay.addItem(overlayitem2);
        mapOverlays.add(itemizedOverlay);
        mc.setCenter(point);
        
        mc.setZoom(17);
		
	}
	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}
	

}
